package com.sanyang.lawyer.mapper.Case;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sanyang.lawyer.entity.Case_type;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultType;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface Case_typeMapper extends BaseMapper<Case_type> {
    
    //根据id查询一条数据
    public Case_type queryByid(int id);
    
    //查询所有的父类型
    @Select("select * from case_type where ppid = 0")
    @ResultType(Case_type.class)
    public List<Case_type> queryParent();
    
    //根据父类型id 查询所有的子类型
    @Select("select * from case_type where ppid = #{pid}")
    @ResultType(Case_type.class)
    public List<Case_type> queryParent_children(int pid);

    //查询法律顾问下的所有类型
    public List<Case_type> listByid();
    
}
